<script src="{$base_dir}js/jquery.tablesorter.min.js" type="text/javascript" ></script>
<script src="{$base_dir}js/jquery.tablesorter.pager.js" type="text/javascript" ></script>
<script src='{$base_dir}js/jquery.contextmenu.r2.packed.js' type="text/javascript" ></script>
<script type="text/javascript" src="{$base_dir}js/selectboxes.js"></script>
<script type="text/javascript" src='{$base_dir}js/FormValidations.js'></script>
<script type="text/javascript" src="{$base_dir}modules/dept_emer/js/AJAX_EmerQueue.js"></script>
<script type="text/javascript" src="{$base_dir}modules/dept_emer/js/AJAX_EmerTestProcess.js"></script>
<script type="text/javascript" src="{$base_dir}modules/dept_emer/js/AJAX_EmerRadiology.js"></script>

<script type="text/javascript">
	{literal}	
	$(document).ready(function () {
		activeMenu('2', '5');
		viewDoctorQueue();
			
		$('table#tableEmergencyQueue').tablesorter();	
		$('table#tableRecoveryQueue').tablesorter();
		$("table#tableEmergencyQueue").bind("sortStart",function() {
			$("table#tableEmergencyQueue tr").each(function () {
				var id = $(this).attr("id");
				if (id.match("Row") != null) {
					$(this).remove();
				}
			});		 
	        
	    });

		$("table#tableEmergencyQueue").bind("sortEnd",function() {
            $(this).find("tr").removeClass("alt");
            $(this).find("tr:even").addClass("alt");      
            
        });

		$("table#tableRecoveryQueue").bind("sortStart",function() {
            $("table#tableRecoveryQueue tr").each(function () {
                var id = $(this).attr("id");
                if (id.match("Row") != null) {
                    $(this).remove();
                }
            });      
            
        });
		$("table#tableRecoveryQueue").bind("sortEnd",function() {
            $(this).find("tr").removeClass("alt");
            $(this).find("tr:even").addClass("alt");      
            
        });
	});
	{/literal}
</script>

<div id="main_queue">

	<div class="filter_container">
		<table cellpadding="0" cellspacing="0" style='width: 100%'>
			<tr>
				<td style='padding-left: 5px'>
					<span>{translate}Date{/translate} &nbsp;&nbsp;</span>
					<span class="label">{$today}</span>
				</td>
				<td>
					<span>{translate}Patient number{/translate} &nbsp;&nbsp;</span>
					<span id="patientNumberField" class="label">{$patientNumber}</span>
				</td>			
				<td align='right'>
					<div id="reload" style="display:none; width: 100px;" align="right">
						<a href="javascript:viewDoctorQueue();" title="{translate}Update list of patients{/translate}"><img src="{$base_uri}/images/refresh.png"/></a>						
					</div>
					<div id="innerLoading" style="display:block; width: 100px;" align="right">
						<img src="{$base_uri}/images/ajax-loader.gif"/>
					</div>
				</td>
			</tr>
		</table>
	</div>			
	
	<div id="emergencyQueue" style='margin-top: 10px;'>
		<div class="documentListHeader">
			<span> {translate}Emergency queue{/translate} </span>
		</div>
		<table id="tableEmergencyQueue" cellspacing="0" cellpadding="0" class="grid" style="width: 100%">						
			<thead>
				<tr>
					<th>{translate}Order number{/translate}</th>
					<th>{translate}Patient_1{/translate}</th>
					<th>{translate}Patient's ID_1{/translate}</th>								
					<th>{translate}Check-in{/translate}</th>
					<th>{translate}Relative{/translate}</th>																
					<th>{translate}Room/Bed{/translate}</th>								
					<th>&nbsp;</th>
					<th>&nbsp;</th>																
					<th>&nbsp;</th>																		
				</tr>
			</thead>
			<tbody>
			</tbody>
		</table>
	</div>
				
	<div id="recoveryQueue" style='margin-top: 10px;'>
		<div class="documentListHeader">
			<span> {translate}Saving-room queue{/translate} </span>
		</div>
		<table id="tableRecoveryQueue" cellspacing="0" cellpadding="0" class="grid" style="width: 100%">						
			<thead>
				<tr>
					<th>{translate}Order number{/translate}</th>
					<th>{translate}Patient_1{/translate}</th>
					<th>{translate}Patient's ID_1{/translate}</th>								
					<th>{translate}Check-in{/translate}</th>
					<th>{translate}Relative{/translate}</th>																
					<th>{translate}Room/Bed{/translate}</th>
					<th>&nbsp;</th>
					<th>&nbsp;</th>
					<th>&nbsp;</th>																		
				</tr>
			</thead>
			<tbody>
			</tbody>
		</table>
	</div>
</div>
<div id="changeBedDialog" style="display: none;" title="{translate}Assign bed{/translate}"></div>
<div id="bedStatusDialog" style="display: none;"></div>
<div id="testAssignDialog" style="display: none;"></div>
{include file="icd_10/element_icd10_selector.html"}
	